package com.share;

//import com.share.autoconfigure.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * author:caifan
 * date:2019/8/28
 */
@RestController
@SpringBootApplication
public class Application {
   /* @Autowired
    PersonService personService;*/

    @Autowired
    RestTemplate restTemplate;

    @Autowired
    Environment environment;

    public static void main(String[] args) {
        SpringApplication.run(Application.class);
    }

    @RequestMapping("/hello")
    public String hello() {
        return "hello";
    }

    @RequestMapping("/person")
    public String getPerson() {
//        personService.sayHello();
        System.out.println(environment.getProperty("my.person.name"));
        return "中国";
    }
}
